package jhlee42;

import java.io.ObjectInputStream.GetField;

public class J12SungJuk {

	public static void main(String[] args) {
	
		SungJuk taehee = new SungJuk();
		SungJuk sooji = new SungJuk();
		SungJuk jihyun = new SungJuk();
		
		
		String a ="taehee";
		
		taehee.name = "김태희";
		taehee.kor = 99;
		taehee.eng = 89;
		taehee.mat = 79;
	
		sooji.name = "수지";
		sooji.kor = 50;
		sooji.eng = 70;
		sooji.mat = 10;

		
		System.out.println(taehee.getName());
		System.out.println(taehee.getTotal());
		System.out.println(taehee.getAverage());
		System.out.println(taehee.getGrade());	
		
		System.out.println(sooji.getName());
		System.out.println(sooji.getTotal());
		System.out.println(sooji.getAverage());
		System.out.println(sooji.getGrade());	
	}// main	
} // class		
		
		
class SungJuk{	
	
	//static int num = 0;
	
	String name;
	int kor,eng,mat,tot;
	double avg;
	char grd;

		
	
		public String getName(){
			//num++;
			return name;
		}
		public int getTotal(){		
			return kor+eng+mat;		
		}
		public int getAverage(){	
			return getTotal()/3;
		}
		public char getGrade(){
			char grd;
			switch ((int)getAverage()/10) {
			case 10:
			case 9:grd = '수'; break;
			case 8:grd = '우'; break;
			case 7:grd = '미'; break;
			case 6:grd = '양'; break;
			default : grd = '가'; 
		    }
			return grd;
		}		
}
